home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / vbasic / receipt.exe / GRID1DLG.FRM < prev    next >
Text File  |  1993-07-22  |  18KB  |  573 lines

  1. VERSION 2.00
  2. Begin Form Form3 
  3.    Caption         =   "Item 1"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   750
  6.    ClientTop       =   1845
  7.    ClientWidth     =   8310
  8.    Height          =   5070
  9.    Left            =   690
  10.    LinkMode        =   1  'Source
  11.    LinkTopic       =   "Form3"
  12.    ScaleHeight     =   311
  13.    ScaleMode       =   3  'Pixel
  14.    ScaleWidth      =   554
  15.    Top             =   1500
  16.    Width           =   8430
  17.    Begin CommandButton Command1 
  18.       Caption         =   "Done"
  19.       Height          =   375
  20.       Index           =   3
  21.       Left            =   6240
  22.       TabIndex        =   8
  23.       Top             =   3960
  24.       Width           =   1455
  25.    End
  26.    Begin CommandButton Command1 
  27.       Caption         =   "Clear"
  28.       Height          =   375
  29.       Index           =   2
  30.       Left            =   4440
  31.       TabIndex        =   7
  32.       Top             =   3960
  33.       Width           =   1455
  34.    End
  35.    Begin CommandButton Command1 
  36.       Caption         =   "Previous Item"
  37.       Height          =   375
  38.       Index           =   1
  39.       Left            =   2640
  40.       TabIndex        =   6
  41.       Top             =   3960
  42.       Width           =   1455
  43.    End
  44.    Begin CommandButton Command1 
  45.       Caption         =   "Next Item"
  46.       Height          =   375
  47.       Index           =   0
  48.       Left            =   720
  49.       TabIndex        =   5
  50.       Top             =   3960
  51.       Width           =   1575
  52.    End
  53.    Begin VBedit BEdit5 
  54.       CellHeight      =   32
  55.       CellWidth       =   22
  56.       CharSet         =   16420
  57.       CombBaseLine    =   24.333
  58.       CombEndHeight   =   8
  59.       CombEndMarker   =   0   'False
  60.       CombHeight      =   4
  61.       FontBold        =   0   'False
  62.       FontItalic      =   0   'False
  63.       FontName        =   "Arial"
  64.       FontSize        =   18
  65.       FontStrikethru  =   0   'False
  66.       FontUnderline   =   0   'False
  67.       Height          =   495
  68.       InflateBottom   =   12
  69.       InflateLeft     =   12
  70.       InflateRight    =   12
  71.       InflateTop      =   16
  72.       Left            =   5160
  73.       TabIndex        =   12
  74.       Text            =   "   0.00"
  75.       Top             =   3120
  76.       Version         =   268435458
  77.       Width           =   2415
  78.    End
  79.    Begin PictureBox Picture2 
  80.       AutoSize        =   -1  'True
  81.       Height          =   510
  82.       Index           =   11
  83.       Left            =   2085
  84.       Picture         =   GRID1DLG.FRX:0000
  85.       ScaleHeight     =   480
  86.       ScaleWidth      =   480
  87.       TabIndex        =   29
  88.       Top             =   2910
  89.       Visible         =   0   'False
  90.       Width           =   510
  91.    End
  92.    Begin PictureBox Picture2 
  93.       AutoSize        =   -1  'True
  94.       Height          =   510
  95.       Index           =   10
  96.       Left            =   1590
  97.       Picture         =   GRID1DLG.FRX:0302
  98.       ScaleHeight     =   480
  99.       ScaleWidth      =   480
  100.       TabIndex        =   28
  101.       Top             =   2910
  102.       Visible         =   0   'False
  103.       Width           =   510
  104.    End
  105.    Begin PictureBox Picture2 
  106.       AutoSize        =   -1  'True
  107.       Height          =   510
  108.       Index           =   9
  109.       Left            =   1095
  110.       Picture         =   GRID1DLG.FRX:0604
  111.       ScaleHeight     =   480
  112.       ScaleWidth      =   480
  113.       TabIndex        =   27
  114.       Top             =   2910
  115.       Visible         =   0   'False
  116.       Width           =   510
  117.    End
  118.    Begin PictureBox Picture2 
  119.       AutoSize        =   -1  'True
  120.       Height          =   510
  121.       Index           =   8
  122.       Left            =   600
  123.       Picture         =   GRID1DLG.FRX:0906
  124.       ScaleHeight     =   480
  125.       ScaleWidth      =   480
  126.       TabIndex        =   26
  127.       Top             =   2910
  128.       Visible         =   0   'False
  129.       Width           =   510
  130.    End
  131.    Begin PictureBox Picture2 
  132.       AutoSize        =   -1  'True
  133.       Height          =   510
  134.       Index           =   7
  135.       Left            =   105
  136.       Picture         =   GRID1DLG.FRX:0C08
  137.       ScaleHeight     =   480
  138.       ScaleWidth      =   480
  139.       TabIndex        =   25
  140.       Top             =   2910
  141.       Visible         =   0   'False
  142.       Width           =   510
  143.    End
  144.    Begin PictureBox Picture1 
  145.       AutoSize        =   -1  'True
  146.       Height          =   510
  147.       Left            =   7080
  148.       ScaleHeight     =   480
  149.       ScaleWidth      =   480
  150.       TabIndex        =   16
  151.       Top             =   1920
  152.       Width           =   510
  153.    End
  154.    Begin VBedit BEdit4 
  155.       CellHeight      =   32
  156.       CellWidth       =   22
  157.       CombBaseLine    =   24.333
  158.       CombEndHeight   =   8
  159.       CombEndMarker   =   0   'False
  160.       CombHeight      =   4
  161.       FontBold        =   0   'False
  162.       FontItalic      =   0   'False
  163.       FontName        =   "Arial"
  164.       FontSize        =   18
  165.       FontStrikethru  =   0   'False
  166.       FontUnderline   =   0   'False
  167.       Height          =   1095
  168.       InflateBottom   =   12
  169.       InflateLeft     =   12
  170.       InflateRight    =   12
  171.       InflateTop      =   16
  172.       Left            =   1440
  173.       TabIndex        =   9
  174.       Top             =   1680
  175.       Version         =   268435458
  176.       Width           =   5415
  177.    End
  178.    Begin VBedit BEdit3 
  179.       CellHeight      =   32
  180.       CellWidth       =   22
  181.       CharSet         =   16388
  182.       CombBaseLine    =   28
  183.       CombEndHeight   =   8
  184.       CombEndMarker   =   0   'False
  185.       CombHeight      =   4
  186.       FontBold        =   0   'False
  187.       FontItalic      =   0   'False
  188.       FontName        =   "Arial"
  189.       FontSize        =   18
  190.       FontStrikethru  =   0   'False
  191.       FontUnderline   =   0   'False
  192.       Height          =   495
  193.       InflateBottom   =   12
  194.       InflateLeft     =   12
  195.       InflateRight    =   12
  196.       InflateTop      =   16
  197.       Left            =   6255
  198.       TabIndex        =   15
  199.       Top             =   840
  200.       Version         =   268435458
  201.       Width           =   1335
  202.    End
  203.    Begin VBedit BEdit2 
  204.       CellHeight      =   32
  205.       CellWidth       =   22
  206.       CharSet         =   16651
  207.       CombBaseLine    =   24.333
  208.       CombEndHeight   =   8
  209.       CombEndMarker   =   0   'False
  210.       CombHeight      =   4
  211.       FontBold        =   0   'False
  212.       FontItalic      =   0   'False
  213.       FontName        =   "Arial"
  214.       FontSize        =   18
  215.       FontStrikethru  =   0   'False
  216.       FontUnderline   =   0   'False
  217.       Height          =   495
  218.       InflateBottom   =   12
  219.       InflateLeft     =   12
  220.       InflateRight    =   12
  221.       InflateTop      =   16
  222.       Left            =   3480
  223.       TabIndex        =   11
  224.       Top             =   840
  225.       Version         =   268435458
  226.       Width           =   1095
  227.    End
  228.    Begin VBedit BEdit1 
  229.       CellHeight      =   32
  230.       CellWidth       =   22
  231.       CharSet         =   16388
  232.       CombBaseLine    =   24.333
  233.       CombEndHeight   =   8
  234.       CombEndMarker   =   0   'False
  235.       CombHeight      =   4
  236.       FontBold        =   0   'False
  237.       FontItalic      =   0   'False
  238.       FontName        =   "Arial"
  239.       FontSize        =   18
  240.       FontStrikethru  =   0   'False
  241.       FontUnderline   =   0   'False
  242.       Height          =   495
  243.       InflateBottom   =   12
  244.       InflateLeft     =   12
  245.       InflateRight    =   12
  246.       InflateTop      =   16
  247.       Left            =   1200
  248.       TabIndex        =   10
  249.       Top             =   840
  250.       Version         =   268435458
  251.       Width           =   1095
  252.    End
  253.    Begin ComboBox Combo1 
  254.       Height          =   300
  255.       Left            =   960
  256.       TabIndex        =   13
  257.       Top             =   240
  258.       Width           =   3015
  259.    End
  260.    Begin PictureBox Picture2 
  261.       AutoSize        =   -1  'True
  262.       Height          =   510
  263.       Index           =   6
  264.       Left            =   7080
  265.       Picture         =   GRID1DLG.FRX:0F0A
  266.       ScaleHeight     =   480
  267.       ScaleWidth      =   480
  268.       TabIndex        =   21
  269.       Top             =   120
  270.       Visible         =   0   'False
  271.       Width           =   510
  272.    End
  273.    Begin PictureBox Picture2 
  274.       AutoSize        =   -1  'True
  275.       Height          =   510
  276.       Index           =   5
  277.       Left            =   6600
  278.       Picture         =   GRID1DLG.FRX:120C
  279.       ScaleHeight     =   480
  280.       ScaleWidth      =   480
  281.       TabIndex        =   20
  282.       Top             =   120
  283.       Visible         =   0   'False
  284.       Width           =   510
  285.    End
  286.    Begin PictureBox Picture2 
  287.       AutoSize        =   -1  'True
  288.       Height          =   510
  289.       Index           =   4
  290.       Left            =   6120
  291.       Picture         =   GRID1DLG.FRX:150E
  292.       ScaleHeight     =   480
  293.       ScaleWidth      =   480
  294.       TabIndex        =   22
  295.       Top             =   120
  296.       Visible         =   0   'False
  297.       Width           =   510
  298.    End
  299.    Begin PictureBox Picture2 
  300.       AutoSize        =   -1  'True
  301.       Height          =   510
  302.       Index           =   3
  303.       Left            =   5640
  304.       Picture         =   GRID1DLG.FRX:1810
  305.       ScaleHeight     =   480
  306.       ScaleWidth      =   480
  307.       TabIndex        =   17
  308.       Top             =   120
  309.       Visible         =   0   'False
  310.       Width           =   510
  311.    End
  312.    Begin PictureBox Picture2 
  313.       AutoSize        =   -1  'True
  314.       Height          =   510
  315.       Index           =   2
  316.       Left            =   5160
  317.       Picture         =   GRID1DLG.FRX:1B12
  318.       ScaleHeight     =   480
  319.       ScaleWidth      =   480
  320.       TabIndex        =   18
  321.       Top             =   120
  322.       Visible         =   0   'False
  323.       Width           =   510
  324.    End
  325.    Begin PictureBox Picture2 
  326.       AutoSize        =   -1  'True
  327.       Height          =   510
  328.       Index           =   1
  329.       Left            =   4680
  330.       Picture         =   GRID1DLG.FRX:1E14
  331.       ScaleHeight     =   480
  332.       ScaleWidth      =   480
  333.       TabIndex        =   19
  334.       Top             =   120
  335.       Visible         =   0   'False
  336.       Width           =   510
  337.    End
  338.    Begin PictureBox Picture2 
  339.       AutoSize        =   -1  'True
  340.       Height          =   510
  341.       Index           =   0
  342.       Left            =   4200
  343.       Picture         =   GRID1DLG.FRX:2116
  344.       ScaleHeight     =   480
  345.       ScaleWidth      =   480
  346.       TabIndex        =   23
  347.       Top             =   120
  348.       Visible         =   0   'False
  349.       Width           =   510
  350.    End
  351.    Begin Label Label7 
  352.       Caption         =   "Price Each:"
  353.       Height          =   255
  354.       Left            =   3690
  355.       TabIndex        =   4
  356.       Top             =   3240
  357.       Width           =   1095
  358.    End
  359.    Begin Label Label6 
  360.       Caption         =   "$"
  361.       FontBold        =   0   'False
  362.       FontItalic      =   0   'False
  363.       FontName        =   "Arial"
  364.       FontSize        =   18
  365.       FontStrikethru  =   0   'False
  366.       FontUnderline   =   0   'False
  367.       Height          =   375
  368.       Left            =   4920
  369.       TabIndex        =   24
  370.       Top             =   3150
  371.       Width           =   225
  372.    End
  373.    Begin Label Label5 
  374.       Caption         =   "Description:"
  375.       Height          =   255
  376.       Left            =   120
  377.       TabIndex        =   1
  378.       Top             =   1800
  379.       Width           =   1095
  380.    End
  381.    Begin Label Label3 
  382.       Caption         =   "Item No."
  383.       Height          =   255
  384.       Left            =   5040
  385.       TabIndex        =   14
  386.       Top             =   960
  387.       Width           =   735
  388.    End
  389.    Begin Label Label2 
  390.       Caption         =   "Unit:"
  391.       Height          =   255
  392.       Left            =   2880
  393.       TabIndex        =   3
  394.       Top             =   960
  395.       Width           =   375
  396.    End
  397.    Begin Label Label1 
  398.       Caption         =   "Quantity:"
  399.       Height          =   255
  400.       Left            =   240
  401.       TabIndex        =   2
  402.       Top             =   960
  403.       Width           =   735
  404.    End
  405.    Begin Label Label4 
  406.       Caption         =   "Item:"
  407.       Height          =   255
  408.       Left            =   240
  409.       TabIndex        =   0
  410.       Top             =   240
  411.       Width           =   495
  412.    End
  413. End
  414. Dim CurItem As Integer
  415.  
  416. Sub Combo1_Click ()
  417.    Picture1.Picture = Picture2(Combo1.ListIndex).Picture
  418.    BEdit2.Text = ItemInfo(Combo1.ListIndex).Unit
  419.    BEdit3.Text = LTrim$(Str$(Combo1.ListIndex))
  420.    BEdit4.Text = ItemInfo(Combo1.ListIndex).Info
  421.    BEdit5.Text = Format$(ItemInfo(Combo1.ListIndex).Price, "###0.00")
  422. End Sub
  423.  
  424. Sub Command1_Click (Index As Integer)
  425.    Select Case Index
  426.       Case 0
  427.          Form2.Grid1.Row = CurItem      ' Save current entry
  428.          Form2.Grid1.Col = 0
  429.          Form2.Grid1.Text = BEdit1.Text
  430.          Form2.Grid1.Col = 1
  431.          Form2.Grid1.Text = BEdit2.Text
  432.          Form2.Grid1.Col = 2
  433.          Form2.Grid1.Text = BEdit3.Text
  434.          Form2.Grid1.Col = 3
  435.          Form2.Grid1.Text = BEdit4.Text
  436.          Form2.Grid1.Col = 4
  437.          Form2.Grid1.Text = BEdit5.Text
  438.          CompressItems
  439.          If CurItem < MAXITEMS Then   ' At bottom of list
  440.             CurItem = CurItem + 1     ' create new entry
  441.             NumItems = NumItems + 1
  442.             Form3.Caption = "Item" + Str$(CurItem)
  443.          Else
  444.             MsgBox "No Available Entry Space"
  445.          End If
  446.  
  447.          Form2.Grid1.Row = CurItem       'Highlight current entry
  448.          Form2.Grid1.SelStartCol = 0
  449.          Form2.Grid1.SelEndCol = 5
  450.          Form2.Grid1.SelStartRow = CurItem
  451.          Form2.Grid1.SelEndRow = CurItem
  452.  
  453.          Form2.Grid1.Col = 0
  454.          BEdit1.Text = Form2.Grid1.Text
  455.          Form2.Grid1.Col = 1
  456.          BEdit2.Text = Form2.Grid1.Text
  457.          Form2.Grid1.Col = 2
  458.          BEdit3.Text = Form2.Grid1.Text
  459.          Form2.Grid1.Col = 3
  460.          BEdit4.Text = Form2.Grid1.Text
  461.          Form2.Grid1.Col = 4
  462.          BEdit5.Text = Form2.Grid1.Text
  463.          Combo1.Text = ""
  464.          Picture1.Picture = LoadPicture("")
  465.       
  466.       Case 1
  467.          Form2.Grid1.Row = CurItem      ' Save current entry
  468.          Form2.Grid1.Col = 0
  469.          Form2.Grid1.Text = BEdit1.Text
  470.          Form2.Grid1.Col = 1
  471.          Form2.Grid1.Text = BEdit2.Text
  472.          Form2.Grid1.Col = 2
  473.          Form2.Grid1.Text = BEdit3.Text
  474.          Form2.Grid1.Col = 3
  475.          Form2.Grid1.Text = BEdit4.Text
  476.          Form2.Grid1.Col = 4
  477.          Form2.Grid1.Text = BEdit5.Text
  478.          
  479.          CompressItems
  480.          If CurItem > 1 Then
  481.             CurItem = CurItem - 1
  482.             Form3.Caption = "Item" + Str$(CurItem)
  483.          Else
  484.             MsgBox "At top of List"
  485.          End If
  486.  
  487.          Form2.Grid1.Row = CurItem
  488.          Form2.Grid1.SelStartCol = 0
  489.          Form2.Grid1.SelEndCol = 5
  490.          Form2.Grid1.SelStartRow = CurItem
  491.          Form2.Grid1.SelEndRow = CurItem
  492.  
  493.          Form2.Grid1.Col = 0
  494.          BEdit1.Text = Form2.Grid1.Text
  495.          Form2.Grid1.Col = 1
  496.          BEdit2.Text = Form2.Grid1.Text
  497.          Form2.Grid1.Col = 2
  498.          BEdit3.Text = Form2.Grid1.Text
  499.          Form2.Grid1.Col = 3
  500.          BEdit4.Text = Form2.Grid1.Text
  501.          Form2.Grid1.Col = 4
  502.          BEdit5.Text = Form2.Grid1.Text
  503.          Combo1.Text = ""
  504.          Picture1.Picture = LoadPicture("")
  505.       Case 2
  506.          Combo1.Text = ""
  507.          Picture1.Picture = LoadPicture()
  508.          BEdit1.Text = ""
  509.          BEdit2.Text = ""
  510.          BEdit3.Text = ""
  511.          BEdit4.Text = ""
  512.          BEdit5.Text = ""
  513.       Case 3
  514.          Form2.Grid1.Col = 0
  515.          Form2.Grid1.Text = BEdit1.Text
  516.          Form2.Grid1.Col = 1
  517.          Form2.Grid1.Text = BEdit2.Text
  518.          Form2.Grid1.Col = 2
  519.          Form2.Grid1.Text = BEdit3.Text
  520.          Form2.Grid1.Col = 3
  521.          Form2.Grid1.Text = BEdit4.Text
  522.          Form2.Grid1.Col = 4
  523.          Form2.Grid1.Text = BEdit5.Text
  524.          CalcTotals
  525.          Unload Form3
  526.    End Select
  527.  
  528. End Sub
  529.  
  530. Sub Form_Load ()
  531.    Form3.Top = (Screen.Height - Form3.Height) / 2
  532.    Form3.Left = (Screen.Width - Form3.Width) / 2
  533.  
  534.    Combo1.AddItem "1  Candy Bar"
  535.    Combo1.AddItem "2  Cheeseburger"
  536.    Combo1.AddItem "3  Chips"
  537.    Combo1.AddItem "4  French Fries (small)"
  538.    Combo1.AddItem "5  French Fries (large)"
  539.    Combo1.AddItem "6  Hamburger"
  540.    Combo1.AddItem "7  Visual Basic 1.0"
  541.    Combo1.AddItem "8  Windows 3.1"
  542.    Combo1.AddItem "9  Pizza"
  543.    Combo1.AddItem "10 Soda Pop (small)"
  544.    Combo1.AddItem "11 Soda Pop (large)"
  545.    Combo1.AddItem "12 6' Sub Sandwich"
  546.  
  547.  
  548.    If Form2.Grid1.Row > NumItems Then
  549.       NumItems = NumItems + 1         ' Entering new item
  550.       Form2.Grid1.Row = NumItems
  551.    End If
  552.    CurItem = Form2.Grid1.Row
  553.  
  554.    Form2.Grid1.Row = CurItem
  555.    Form2.Grid1.SelStartCol = 0
  556.    Form2.Grid1.SelEndCol = 5
  557.    Form2.Grid1.SelStartRow = CurItem
  558.    Form2.Grid1.SelEndRow = CurItem
  559.  
  560.    Form2.Grid1.Col = 0
  561.    BEdit1.Text = LTrim$(Form2.Grid1.Text)
  562.    Form2.Grid1.Col = 1
  563.    BEdit2.Text = LTrim$(Form2.Grid1.Text)
  564.    Form2.Grid1.Col = 2
  565.    BEdit3.Text = LTrim$(Form2.Grid1.Text)
  566.    Form2.Grid1.Col = 3
  567.    BEdit4.Text = LTrim$(Form2.Grid1.Text)
  568.    Form2.Grid1.Col = 4
  569.    BEdit5.Text = Format$(Val(Form2.Grid1.Text), "##0.00")
  570.  
  571. End Sub
  572.  
  573.